﻿// /////////////////////////////////// 
//  
//  
//      WiseLink CCF2.0 
//     (c)Copyright 2001-2010 WiseLink Xiaojun (David) Chen 
//        Authored and Owned Xiaojun (David) Chen 
//        All Right Reserved
//  
// /////////////////////////////////// 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CCF20Model;
using WiseLink.RDS.Resource;


namespace CCF20Model
{
    public class ChinaMobileRDSZIC : ZICBase
    {
        public ChinaMobileRDSZIC()
        {
            LoggerHelper.LogCCF20(string.Format("ChinaMobile ZIC Url: {0}", zicUrl));
        }

         public bool DeviceRegister(Device device, string is5101CallCenter,out DateTime registerDate)
        {
            string ret;
            object[] parameters = new object[]{
                                            device.DeviceKey,
                                            device.IDCSimNumber,
                                            PID,
                                            Pwd,
                                            device.Vehicle.VehicleLicense,
                                            device.Customer.Name,
                                            "32",
                                            device.Vehicle.VehicleType.Model,
                                            device.Customer.IdentityNo,
                                            device.DeviceType,
                                            "RDS",
                                            device.Vehicle.EngineNo,
                                            device.Vehicle.ChassiNo,
                                            is5101CallCenter,
                                            device.Vehicle.VehicleType.Displacement,
                                            device.Vehicle.VehicleType.EngineType,
                                            device.Customer.Gender.Equals("男")?1:device.Customer.Gender.Equals("女")?2:0,
                                            device.Vehicle.VehicleType.Manufacture,
                                            device.SimCard};

            ret = ExectueMethod(ZICMethod.ProductRegister, parameters);
            registerDate = DateTime.Now;
            return ValideReturnMessageFromZIC(ret);
       }
        
    }
}
